class code2 {
    public int maxProduct(int[] nums) {
        //直接找max1和max2
        int n = nums.length;
        int max1 = 0;int max2 = 0;
        for(int i=0;i<n;i++) {
            if(nums[i]>max1) {
                max2 = max1;
                max1 = nums[i];
                continue;
            }
            if(nums[i]>max2) {
                max2 = nums[i];
            }
        }
        return (max1-1)*(max2-1);
    }
}